]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
NetworkMenu: fix crash when NetworkManger restarts
authorGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 29 Mar 2012 16:51:03 +0000 (18:51 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Mon, 9 Apr 2012 18:33:50 +0000 (20:33 +0200)
nm_active_connection_get_devices() has a (questionable) special case
for the no devices case (which happens if the DBus object is
destroyed because NM went down): it returns null instead of an empty
array. Handle that instead of crashing.

https://bugzilla.gnome.org/show_bug.cgi?id=673043

js/ui/status/network.js

index 5c6babee8a12e3fd24a740294676e6e109cea6f1..f7d2258cff7d250eca61a5970aa90cdf4503c7a3 100644 (file)
@@ -1844,7 +1844,7 @@ const NMApplet = new Lang.Class({
                 if (a._type != NetworkManager.SETTING_VPN_SETTING_NAME) {
                     // find a good device to be considered primary
                     a._primaryDevice = null;
-                    let devices = a.get_devices();
+                    let devices = a.get_devices() || [];
                     for (let j = 0; j < devices.length; j++) {
                         let d = devices[j];
                         if (d._delegate) {